home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / gopher / Unix / gopher1.12 / object / GSgopherobj.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-30  |  2.8 KB  |  103 lines

  1. /********************************************************************
  2.  * $Author: lindner $
  3.  * $Revision: 1.1 $
  4.  * $Date: 1992/12/10 23:27:52 $
  5.  * $Source: /home/mudhoney/GopherSrc/release1.11/object/RCS/GSgopherobj.h,v $
  6.  * $Status: $
  7.  *
  8.  * Paul Lindner, University of Minnesota CIS.
  9.  *
  10.  * Copyright 1991, 1992 by the Regents of the University of Minnesota
  11.  * see the file "Copyright" in the distribution for conditions of use.
  12.  *********************************************************************
  13.  * MODULE: GSgopherobj.h
  14.  * Header file, abstraction of a gopher type
  15.  *********************************************************************
  16.  * Revision History:
  17.  * $Log: GSgopherobj.h,v $
  18.  * Revision 1.1  1992/12/10  23:27:52  lindner
  19.  * gopher 1.1 release
  20.  *
  21.  *
  22.  *********************************************************************/
  23.  
  24.  
  25. #ifndef GSGOPHEROBJ_H
  26. #define GSGOPHEROBJ_H
  27.  
  28. #include "STRstring.h"
  29.  
  30. #define A_FILE      '0'      /* Types of objects */
  31. #define A_DIRECTORY '1'
  32. #define A_CSO       '2'
  33. #define A_ERROR     '3'
  34. #define A_MACHEX    '4'
  35. #define A_PCBIN     '5'
  36. #define A_INDEX     '7'
  37. #define A_TELNET    '8'
  38. #define A_UNIXBIN   '9'
  39. #define A_SOUND     's'
  40. #define A_EVENT     'e'
  41. #define A_CALENDAR  'c'
  42. #define A_GIF       'g'
  43. #define A_HTML      'h'
  44. #define A_TN3270    'T'
  45. #define A_MIME      'M'
  46. #define A_IMAGE     'I'
  47. #define A_EOI        '.'
  48.  
  49.  
  50. /** Our Gopher Object Type **/
  51.  
  52. struct g_struct
  53. {
  54.      char    sFileType;     /* The type of object (A_FILE, A_CSO, etc)*/
  55.      String  *Title;        /* User displayable title */
  56.      String  *Selstr;       /* Selector string on host... */
  57.      String  *Host;         /* Internet name of host                  */
  58.      int     iPort;         /* Port number on host                    */
  59.      int     Itemnum;      /* The number of the item in the directory*/
  60.      int     weight;        /* The weight, expressed as a # from 0-1000 */
  61. };
  62.  
  63.  
  64.  
  65. typedef struct g_struct GopherStruct;
  66. typedef struct g_struct GopherObj;
  67.  
  68. #define GSgetType(a) ((a)->sFileType)
  69. #define GSsetType(a,b) (a)->sFileType=(b)
  70.  
  71. #define GSgetTitle(a) ((STRget((a)->Title)))
  72. #define GSsetTitle(a,b) ((STRset((a)->Title, b)))
  73.  
  74. #define GSgetPath(a) ((STRget((a)->Selstr)))
  75. #define GSsetPath(a,b) ((STRset((a)->Selstr, b)))
  76.  
  77. #define GSgetHost(a) ((STRget((a)->Host)))
  78. #define GSsetHost(a,b) ((STRset((a)->Host, b)))
  79.  
  80. #define GSgetPort(a) ((a)->iPort)
  81. #define GSsetPort(a,b) (a)->iPort=(b)
  82.  
  83. #define GSgetNum(a) ((a)->Itemnum)
  84. #define GSsetNum(a,b) ((a)->Itemnum=(b))
  85.  
  86. #define GSgetWeight(a)   ((a)->weight)
  87. #define GSsetWeight(a,b) ((a)->weight=(b))
  88.  
  89. /*** Real live functions defined in GSgopherobj.c ***/
  90.  
  91. GopherObj *GSnew();
  92. GopherObj *GSnewSet();
  93. void GSdestroy();
  94. void GSinit();
  95. void GStoNet();
  96. void GStoNetHTML();
  97. int  GSfromNet();
  98. int  GSconnect();
  99. int  GSfromLink();
  100. void GStoLink();
  101. void GScpy();
  102. #endif /*GSGOPHEROBJ_H*/
  103.